home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
DO1002.ARJ
/
FILES.SCR
< prev
next >
Wrap
Text File
|
1991-12-04
|
1KB
|
44 lines
* SCRIPT: Files.scr
.pg wi full clr
»ye«
/BIG FILES 14
.#
/FRAME ~179 ~196 ~217 ~191 ~192 ~218
/BOX 10 1 59 7
.bl
/DRAW V 60 2 8 0 ░
/DRAW H 8 11 60 0 ░
/FRAME RESET
.wi 9 10 80 25
»%t«DO»#« has four commands which let you read and write »ye«TEXT
files»#«. These commands are not as powerful as those in
languages like BASIC, "C", or PASCAL. But, they allow you
to »cy«store and retrieve information from text files»#« which you
can use in your scripts.
.pg clr
To read or write from a file you must first »cy«open»#« it and »cy«assign»#« it
to a file »ye«HANDLE»#«. »%t«DO»#« can have »ma«10»#« files open at one time.
A file handle is a number between »ye«1»#« and »ma«10»#«. Once a file is
opened, the other commands use the file handle to refer to the
file rather than the filename.
.pg clr
To process a text file, use the following basic structure:
»%t«/OPEN»cy« {handle} {filename} . . .
»%t«/READ»cy« {handle} . . .
or
»%t«/WRITE»cy« {handle} . . .
»%t«/CLOSE»cy« {handle}
.pg clr #
Files can be opened for »cy«R»#«eading or »cy«W»#«riting, but »ye«not both at the
same time»#«.
The following screens present each of the file-related commands
in detail.
/ENDEXEC